package com.golden.procedure.util;

/**
 * Activiti任务定义名称及ID <b>Description:</b><br>
 * 
 * @author Reading.Reagan</a>
 * @version 1.0
 * @Note <b>ProjectName:</b> business-procedure <br>
 *       <b>PackageName:</b> com.golden.procedure.util <br>
 *       <b>ClassName:</b> TaskDefKey <br>
 *       <b>Date:</b> 2018年9月20日 下午3:14:06
 */
public enum TaskDefKey {

	/** Activiti任务定义ID: 创建工单 */
	CREATE_WORKORDER("创建工单", "createWorkOrder"),
	/** Activiti任务定义ID: 订单上摄控 */
	ORDER_SCHEDULE("预约拍摄", "orderSchedule"),
	/** Activiti任务定义ID: 安排摄影师等成员 */
	ARRENAGE_TEAM("安排成员", "arrenageTeam"),
	/** Activiti任务定义ID: 安排上门车辆 */
	ARRANGE_VEHICLE("安排车辆", "arrangeVehicle"),
	/** Activiti任务定义ID: 上门拍摄上传相片 */
	UPLOAD_PHOTO("上门拍摄", "uploadPhoto"),
	/** Activiti任务定义ID: 看样选片 */
	SELECT_PHOTO("看样选片", "selectPhoto"),
	/** Activiti任务定义ID: 设计制作 */
	DESIGN_PRODUCT("设计制作", "design"),
	/** Activiti任务定义ID: 产品交货 */
	PRODUCT_DELIVERY("产品交货", "delivery");

	private String key;

	private String name;

	private TaskDefKey(String name, String key) {
		this.name = name;
		this.key = key;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getKey() {
		return key;
	}

	public void setKey(String key) {
		this.key = key;
	}

	public static String getNameByKey(String key) {

		for (TaskDefKey taskDefKey : TaskDefKey.values()) {
			if (key.equals(taskDefKey.getKey())) {
				return taskDefKey.getName();
			}
		}
		return null;
	}
}
